package pers.liyan.shi.springcloud.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * springMVC 配置
 * @author shily
 * @date 2019/5/23 14:21
 */
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //重定向
        registry.addViewController("/").setViewName("redirect:swagger-ui.html");
    }

    /**
     * WebMvcConfigurerAdapter过时
     */
    // public WebMvcConfigurerAdapter myWebMvcConfigurerAdapter(){
    //
    // }

}
